package cn.wolfcode.luowowo.common.result;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class Result extends StatusCode {

    private String resultCode;

    private String msg;

    private Object resultData;

    public Result(){
        this(RESULT_SUCCESS,map.get(RESULT_SUCCESS));
    }

    public Result(String resultCode){
        this.resultCode = resultCode;
        this.msg = map.get(resultCode);
    }

    public Result(String resultCode,String msg){
        this.resultCode = resultCode;
        if(msg == null && "".equals(msg)){
            this.msg = map.get(resultCode);
        }else{
            this.msg = msg;
        }
    }

    public Result(String resultCode,String msg,Object resultData){
        this.resultCode = resultCode;
        if(msg == null && "".equals(msg)){
            this.msg = map.get(resultCode);
        }else{
            this.msg = msg;
        }
        this.resultData = resultData;
    }

}
